package cn.iocoder.yudao.module.engine.model.context;

import lombok.Data;
import org.springframework.util.StopWatch;

import java.util.concurrent.atomic.AtomicInteger;

@Data
public class BillingContext {
    private final StopWatch duration = new StopWatch();
    private Boolean balanceSufficient = false; // 余额是否足够

    public void startDuration() {
        duration.start();
    }

    public long getCurrentDurationMs() {
        duration.stop();
        final long totalTimeMillis = duration.getTotalTimeMillis();
        duration.start();
        return totalTimeMillis;
    }

}
